#this makefile is to build drivers for devices
#write by dbian 2011-11-21
OUTPDIR=bin
all: $(OUTPDIR)/boxcar.dll $(OUTPDIR)/lockin7265.dll \
	$(OUTPDIR)/lockinSTF.dll $(OUTPDIR)/motor.dll \
	$(OUTPDIR)/motor_mc200.dll \
	$(OUTPDIR)/shutDriver.dll $(OUTPDIR)/stageDriver.dll

SERIALREF=common/serialport.h common/serialport.cpp
READERREF=common/read_dev_head.h $(SERIALREF)
MOTORREF=common/motor_head.h $(SERIALREF)

$(OUTPDIR)/boxcar.dll:boxcar/boxcar.cpp $(READERREF) 
	g++ -o $@ -shared boxcar/boxcar.cpp common/serialport.cpp
$(OUTPDIR)/lockin7265.dll:lockin7265/lockin7265.cpp $(READERREF) 
	g++ -o $@ -shared lockin7265/lockin7265.cpp common/serialport.cpp
$(OUTPDIR)/lockinSTF.dll:lockinSTF/lockinSTF.cpp $(READERREF) 
	g++ -o $@ -shared lockinSTF/lockinSTF.cpp common/serialport.cpp
$(OUTPDIR)/motor.dll:motor/motor.cpp $(MOTORREF) 
	g++ -o $@ -shared motor/motor.cpp common/serialport.cpp
$(OUTPDIR)/motor_mc200.dll:motor_mc200/motor_mc200.cpp $(MOTORREF) 
	g++ -o $@ -shared motor_mc200/motor_mc200.cpp common/serialport.cpp

$(OUTPDIR)/shutDriver.dll:shutDriver/shutDriver.cpp $(SERIALREF) 
	g++ -o $@ -shared shutDriver/shutDriver.cpp common/serialport.cpp
$(OUTPDIR)/stageDriver.dll:stageDriver/stageDriver.cpp $(SERIALREF) 
	g++ -o $@ -shared stageDriver/stageDriver.cpp common/serialport.cpp



clean:
	del mk_dst *.o 
